home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIP Haziran 2001.iso / prog / share / 04 / setup.exe / MM6.Cab / F1708_StyleTrans.scpt.F6A680DD_F3FB_4CF3_BABB_0D0F06E630F5 < prev    next >
Text File  |  2000-08-17  |  1KB  |  34 lines

  1. function CSGetLayerClip (el) {
  2.     if (el.isIE) return (new CSRect(0,0,el.offsetWidth,el.offsetHeight));
  3.     else return (new CSRect(el.clip.left,el.clip.top,el.clip.width,el.clip.height));
  4. }
  5. function CSSetLayerClip (el,clipRect) {
  6.     var l,t,r,b;
  7.     l=clipRect.left; t=clipRect.top; r=l+clipRect.width; b=t+clipRect.height;
  8.     if(el.isIE) { el.style.clip = "rect("+ t + " " + r + " " + b + " " + l + ")"; }
  9.     else {
  10.         el.clip.left=l; el.clip.top=t; 
  11.         el.clip.width=clipRect.width; el.clip.height=clipRect.height;
  12.     }
  13.     CSSetStyleVis(el.layer);
  14. }
  15. function CSRect (left,top,width,height) {
  16. this.left=left; this.top=top; this.width=width; this.height=height;
  17. }
  18. function CSCreateTransElement (layer, steps) {
  19.     var el;
  20.     if (IsIE()) el=document.all.tags("div")[layer];
  21.     else el=CSNSStyl(layer);
  22.     if (el==null) return null;
  23.     if (el.locked && (el.locked == true)) return null;
  24.     el.isIE=IsIE();
  25.     el.clipRect=CSGetLayerClip(el);
  26.     if (el.clipRect==null) return null;
  27.     el.maxValue=steps;
  28.     if (el.maxValue<=0) el.maxValue=30;
  29.     el.modus=""; el.layer=layer;
  30.     el.width=el.clipRect.width; el.height=el.clipRect.height;
  31.     el.locked = true;
  32.     return el;
  33. }
  34. function CSDisposeTransElement (el) { el.locked = false; }